package com.hotel.user.feign;

import com.hotel.common.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "hotel-cloud-po")
public interface PoClient {

    // Hotel APIs
    @GetMapping("/api/hotels")
    Result<List<Map<String, String>>> listHotels();

    @PostMapping("/api/hotels")
    Result<Long> createHotel(@RequestBody Map<String, Object> body);

    @PutMapping("/api/hotels")
    Result<Void> updateHotel(@RequestBody Map<String, Object> body);

    @DeleteMapping("/api/hotels/{id}")
    Result<Void> deleteHotel(@PathVariable("id") Long id);

    // Room APIs
    @GetMapping("/api/rooms")
    Result<List<Map<String, String>>> listRooms(@RequestParam(name = "hotelId", required = false) Long hotelId);

    @PostMapping("/api/rooms")
    Result<Long> createRoom(@RequestBody Map<String, Object> body);

    @PutMapping("/api/rooms")
    Result<Void> updateRoom(@RequestBody Map<String, Object> body);

    @DeleteMapping("/api/rooms/{id}")
    Result<Void> deleteRoom(@PathVariable("id") Long id);
}


